<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php echo ($meta_title); ?>管理平臺</title>
    <link href="/sjc/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="/sjc/Public/Admin/css/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="/sjc/Public/Admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/sjc/Public/Admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="/sjc/Public/Admin/css/style.css" media="all">
	<link rel="stylesheet" type="text/css" href="/sjc/Public/Admin/css/<?php echo (C("COLOR_STYLE")); ?>.css" media="all">
     <!--[if lt IE 9]>
    <script type="text/javascript" src="/sjc/Public/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="/sjc/Public/static/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="/sjc/Public/Admin/js/jquery.mousewheel.js"></script>
    <!--<![endif]-->
    
    <style>
        .logo{ text-align:center; color: #FFF; font-size: 15px}
    </style>
</head>
<body>
    <!-- 頭部 -->
    <div class="header">
        <!-- Logo -->
        <span class="logo"><?php echo C('WEB_SITE_TITLE');?></span>
        <!-- /Logo -->

        <!-- 主導航 -->
        <ul class="main-nav">
            <?php if(is_array($__MENU__["main"])): $i = 0; $__LIST__ = $__MENU__["main"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li class="<?php echo ((isset($menu["class"]) && ($menu["class"] !== ""))?($menu["class"]):''); ?>"><a href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <!-- /主導航 -->

        <!-- 用戶欄 -->
        <div class="user-bar">
            <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
            <ul class="nav-list user-menu hidden">
                <li class="manager">妳好，<em title="<?php echo session('user_auth.username');?>"><?php echo session('user_auth.username');?></em></li>
                <li><a href="<?php echo U('User/updatePassword');?>">修改密碼</a></li>
                <li><a href="<?php echo U('User/updateNickname');?>">修改昵稱</a></li>
                <li><a href="<?php echo U('Public/logout');?>">退出</a></li>
            </ul>
        </div>
    </div>
    <!-- /頭部 -->

    <!-- 邊欄 -->
    <div class="sidebar">
        <!-- 子導航 -->
        
<div id="subnav" class="subnav">
    <?php if(!empty($_extra_menu)): ?>
        <?php echo extra_menu($_extra_menu,$__MENU__); endif; ?>
    <?php if(is_array($__MENU__["child"])): $i = 0; $__LIST__ = $__MENU__["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub_menu): $mod = ($i % 2 );++$i;?><!-- 子導航 -->
        <?php if(!empty($sub_menu)): if(!empty($key)): ?><h3><i class="icon icon-unfold"></i><?php echo ($key); ?></h3><?php endif; ?>
            <ul class="side-sub-menu">
                <?php if(is_array($sub_menu)): $i = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li>
                        <a class="item" href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a>
                    </li><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul><?php endif; ?>
        <!-- /子導航 --><?php endforeach; endif; else: echo "" ;endif; ?>

<!-- <h3>
 	<i class="icon <?php if(!in_array((ACTION_NAME), explode(',',"1"))): ?>icon-fold<?php endif; ?>"></i>
 	產品介紹
 </h3>
 	<ul class="side-sub-menu <?php if(!in_array((ACTION_NAME), explode(',',"inde"))): ?>subnav-off<?php endif; ?>">
 		<li <?php if((ACTION_NAME) == "a"): ?>class="current"<?php endif; ?>><a class="item" href="<?php echo U('article/index','cate_id=44');?>">產品分類</a></li>
                 <li <?php if((ACTION_NAME) == "bg"): ?>class="current"<?php endif; ?>><a class="item" href="<?php echo U('article/index','cate_id=45');?>">背景圖</a></li>	
                <li <?php if((ACTION_NAME) == "product"): ?>class="current"<?php endif; ?>><a class="item" href="<?php echo U('article/product');?>">產品列表</a></li>		
 	</ul>-->
    <?php if(is_array($nodes)): $i = 0; $__LIST__ = $nodes;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub_menu): $mod = ($i % 2 );++$i;?><!-- 子導航 -->
        <?php if(!empty($sub_menu)): ?><h3>
            	<i class="icon <?php if(($sub_menu['current']) != "1"): ?>icon-fold<?php endif; ?>"></i>
            	<?php if(($sub_menu['allow_publish']) > "0"): ?><a class="item" href="<?php echo (u($sub_menu["url"])); ?>"><?php echo ($sub_menu["title"]); ?></a><?php else: echo ($sub_menu["title"]); endif; ?>
            </h3>
            <ul class="side-sub-menu <?php if(($sub_menu["current"]) != "1"): ?>subnav-off<?php endif; ?>">
                <?php if(is_array($sub_menu['_child'])): $i = 0; $__LIST__ = $sub_menu['_child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li <?php if($menu['id'] == $cate_id or $menu['current'] == 1): ?>class="current"<?php endif; ?>>
                        <?php if(($menu['allow_publish']) > "0"): ?><a class="item" href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a><?php else: ?><a class="item" href="javascript:void(0);"><?php echo ($menu["title"]); ?></a><?php endif; ?>

                        <!-- 壹級子菜單 -->
                        <?php if(isset($menu['_child'])): ?><ul class="subitem">
                        	<?php if(is_array($menu['_child'])): foreach($menu['_child'] as $key=>$three_menu): ?><li>
                                <?php if(($three_menu['allow_publish']) > "0"): ?><a class="item" href="<?php echo (u($three_menu["url"])); ?>"><?php echo ($three_menu["title"]); ?></a><?php else: ?><a class="item" href="javascript:void(0);"><?php echo ($three_menu["title"]); ?></a><?php endif; ?>
                                <!-- 二級子菜單 -->
                                <?php if(isset($three_menu['_child'])): ?><ul class="subitem">
                                	<?php if(is_array($three_menu['_child'])): foreach($three_menu['_child'] as $key=>$four_menu): ?><li>
                                        <?php if(($four_menu['allow_publish']) > "0"): ?><a class="item" href="<?php echo U('index','cate_id='.$four_menu['id']);?>"><?php echo ($four_menu["title"]); ?></a><?php else: ?><a class="item" href="javascript:void(0);"><?php echo ($four_menu["title"]); ?></a><?php endif; ?>
                                        <!-- 三級子菜單 -->
                                        <?php if(isset($four_menu['_child'])): ?><ul class="subitem">
                                        	<?php if(is_array($four_menu['_child'])): $i = 0; $__LIST__ = $four_menu['_child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$five_menu): $mod = ($i % 2 );++$i;?><li>
                                            	<?php if(($five_menu['allow_publish']) > "0"): ?><a class="item" href="<?php echo U('index','cate_id='.$five_menu['id']);?>"><?php echo ($five_menu["title"]); ?></a><?php else: ?><a class="item" href="javascript:void(0);"><?php echo ($five_menu["title"]); ?></a><?php endif; ?>
                                            </li><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </ul><?php endif; ?>
                                        <!-- end 三級子菜單 -->
                                    </li><?php endforeach; endif; ?>
                                </ul><?php endif; ?>
                                <!-- end 二級子菜單 -->
                            </li><?php endforeach; endif; ?>
                        </ul><?php endif; ?>
                        <!-- end 壹級子菜單 -->
                    </li><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul><?php endif; ?>
        <!-- /子導航 --><?php endforeach; endif; else: echo "" ;endif; ?>
  <ul class="side-sub-menu">
      <li></li>
 	</ul>
    <!--自定義導航-->
<h3>
 	<i class="icon <?php if(!in_array((ACTION_NAME), explode(',',"1"))): ?>icon-fold<?php endif; ?>"></i>
        <a href="<?php echo U('article/edit',array('cate_id'=>44,'id'=>7));?>">條件篩選</a>
 </h3>    
    <ul class="side-sub-menu <?php if(!in_array((ACTION_NAME), explode(',',"inde"))): ?>subnav-off<?php endif; ?>">
 		
 	</ul>  
<h3>
 	<i class="icon <?php if(!in_array((ACTION_NAME), explode(',',"1"))): ?>icon-fold<?php endif; ?>"></i>
        <a href="<?php echo U('article/house');?>">樓盤信息</a>
 </h3>
 	<ul class="side-sub-menu <?php if(!in_array((ACTION_NAME), explode(',',"inde"))): ?>subnav-off<?php endif; ?>">
 		
 	</ul>
 <h3>
 	<i class="icon <?php if(!in_array((ACTION_NAME), explode(',',"1"))): ?>icon-fold<?php endif; ?>"></i>
        <a href="<?php echo U('article/index',array('cate_id'=>47));?>">聯繫我們</a>
 </h3>    
    <ul class="side-sub-menu <?php if(!in_array((ACTION_NAME), explode(',',"inde"))): ?>subnav-off<?php endif; ?>">
 		
 	</ul>   
<h3>
 	<i class="icon <?php if(!in_array((ACTION_NAME), explode(',',"1"))): ?>icon-fold<?php endif; ?>"></i>
        <a href="<?php echo U('article/message');?>">留言板</a>
 </h3>
 	<ul class="side-sub-menu <?php if(!in_array((ACTION_NAME), explode(',',"inde"))): ?>subnav-off<?php endif; ?>">
 		
 	</ul> 
 <h3>
 	<i class="icon <?php if(!in_array((ACTION_NAME), explode(',',"1"))): ?>icon-fold<?php endif; ?>"></i>
 	網站設置
 </h3>
 	<ul class="side-sub-menu <?php if(!in_array((ACTION_NAME), explode(',',"inde"))): ?>subnav-off<?php endif; ?>">
            <li <?php if((ACTION_NAME) == "a"): ?>class="current"<?php endif; ?>><a class="item" href="<?php echo U('article/edit',array('cate_id'=>50,'id'=>35));?>">logo設置</a></li>
                <li <?php if((ACTION_NAME) == "a"): ?>class="current"<?php endif; ?>><a class="item" href="<?php echo U('Config/group');?>">網站基本資料</a></li>	
 	</ul>
  
    <!-- 回收站 -->
	<?php if(($show_recycle) == "1"): ?><h3>
        <em class="recycle"></em>
        <a href="<?php echo U('article/recycle');?>">回收站</a>
    </h3><?php endif; ?>
</div>
<script>
    $(function(){
      
        $(".side-sub-menu li").hover(function(){
            $(this).addClass("hover");
        },function(){
            $(this).removeClass("hover");
        });
    })
</script>


        <!-- /子導航 -->
    </div>
    <!-- /邊欄 -->

    <!-- 內容區 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">這是內容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
            <?php if(!empty($_show_nav)): ?><div class="breadcrumb">
                <span>您的位置:</span>
                <?php $i = '1'; ?>
                <?php if(is_array($_nav)): foreach($_nav as $k=>$v): if($i == count($_nav)): ?><span><?php echo ($v); ?></span>
                    <?php else: ?>
                    <span><a href="<?php echo ($k); ?>"><?php echo ($v); ?></a>&gt;</span><?php endif; ?>
                    <?php $i = $i+1; endforeach; endif; ?>
            </div><?php endif; ?>
            <!-- nav -->
            

            

<script type="text/javascript" src="/sjc/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/sjc/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="/sjc/Addons/UploadImages/style/UploadImages.css">
<style>
.col-left{ float: left}
.unit{border: 0; background: #f6f6f6; width: 50px;  outline: none; height: 20px; text-align: center}
</style>
<div class="main-title cf">
<h2>
基本資料 
</h2>
</div>
<!-- 標簽頁導航 -->
<div class="tab-wrap">
<!--	<ul class="tab-nav nav">
<?php $_result=parse_config_attr($model['field_group']);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$group): $mod = ($i % 2 );++$i;?><li data-tab="tab<?php echo ($key); ?>" <?php if(($key) == "1"): ?>class="current"<?php endif; ?>><a href="javascript:void(0);"><?php echo ($group); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
</ul>-->
<div class="tab-content">
<!-- 表單 -->
<form id="form" action="<?php echo U('update');?>" method="post" class="form-horizontal">
<!-- 基礎文檔模型 -->
<input type="text" value="2" name="type"  style="display: none">
<input type="text" value="0" name="cover_id" style="display: none">
<input type="text" value="0" name="link_id" style="display: none"> 
<div class="form-item cf">
                    <label class="item-label">标题<span class="check-tips">（文档标题）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-large" name="title" value="<?php echo ($data["title"]); ?>">                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">物業名稱<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-large" name="names" value="<?php echo ($data["names"]); ?>">                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">描述<span class="check-tips"></span></label>
                    <div class="controls">
                        <label class="textarea input-large">
                                <textarea name="description"><?php echo ($data["description"]); ?></textarea>
                                </label>                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">銷售類型<span class="check-tips"></span></label>
                    <div class="controls">
                        <label class="radio ">
                                    <input class='radios' type="radio" value="0" name="selltype" data-check='<?php echo ($data["selltype"]); ?>'>出售                                	</label><label class="radio">
                                    <input class='radios' type="radio" value="1" name="selltype" data-check='<?php echo ($data["selltype"]); ?>'>出租                                	</label>                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">所在地<span class="check-tips"></span></label>
                    <span class="add" style="display:none"><?php echo ($data["add"]); ?></span>
                    <div class="controls">
                        <select id="select1" name="add" >
                            <?php if(is_array($searchadd)): $i = 0; $__LIST__ = $searchadd;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><option><?php echo ($val); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>                 </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">物業類型<span class="check-tips"></span></label>
                       <span class="house_type" style="display:none"><?php echo ($data["house_type"]); ?></span>
                    <div class="controls">
                           <select id="select2" name="house_type">
                                <?php if(is_array($searchtype)): $i = 0; $__LIST__ = $searchtype;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><option><?php echo ($val); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>                        </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">價格範圍<span class="check-tips"></span></label>
                              <span class="prices" style="display:none"><?php echo ($data["prices"]); ?></span>
                    <div class="controls">
                          <select id="select3" name="prices">
                               <?php if(is_array($searchprices)): $i = 0; $__LIST__ = $searchprices;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><option><?php echo ($val); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>     
                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">是否推薦到首頁顯示<span class="check-tips"></span></label>
                    <div class="controls">
                        <label class="radio">
                                    <input class='radios' type="radio" value="0" name="hots" data-check='<?php echo ($data["hots"]); ?>'>是                                	</label><label class="radio">
                                    <input class='radios' type="radio" value="1" name="hots" data-check='<?php echo ($data["hots"]); ?>'>否                                	</label>                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">面積<span class="check-tips">（單位自定義）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="area" value="<?php echo ($data["area"]); ?>">   <span>(<input  name="unit_area" type="text" class="unit" value="<?php echo ($data["unit_area"]); ?>">)</span>                      </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">價格<span class="check-tips">（單位自定義）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="prices2" value="<?php echo ($data["prices2"]); ?>">  <span>(<input  name="unit_price" type="text" class="unit" value="<?php echo ($data["unit_price"]); ?>">)</span>                  </div>
                </div>

<div class="form-item cf col-left">
                    <label class="item-label">房型<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="shi" value="<?php echo ($data["shi"]); ?>">   <span>室</span>                 </div>
                </div>
<div class="form-item cf col-left">
                               <label class="item-label"><span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="ting" value="<?php echo ($data["ting"]); ?>">   <span>廳</span>                  </div>
                </div>
<div class="form-item cf ">
                          <label class="item-label"><span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="wei" value="<?php echo ($data["wei"]); ?>">    <span>衛</span>                 </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">電話<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-large" name="tel" value="<?php echo ($data["tel"]); ?>">                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">圖片上傳<span class="check-tips"></span></label>
                    <div class="controls">
                        <script type="text/javascript" src="/sjc/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/sjc/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="/sjc/Addons/UploadImages/style/UploadImages.css">
    <div id="upload_picture_pic" class="uploadify" style="height: 30px; width: 120px;"><object id="SWFUpload_1" type="application/x-shockwave-flash" data="/sjc/Public/static/uploadify/uploadify.swf?preventswfcaching=1433321783722" width="120" height="30" class="swfupload" style="position: absolute; z-index: 1;"><param name="wmode" value="transparent"><param name="movie" value="/sjc/Public/static/uploadify/uploadify.swf?preventswfcaching=1433321783722"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_1&amp;uploadURL=%2Fsjc%2Findex.php%3Fs%3D%2FAdmin%2FFile%2FuploadPicture%2Fsession_id%2Fu21htpemp67tmhf4do23bskak2.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=&amp;filePostName=download&amp;fileTypes=*.jpg%3B%20*.png%3B%20*.gif%3B&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=%2Fsjc%2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2"></object><div id="upload_picture_pic-button" class="uploadify-button " style="height: 30px; line-height: 30px; width: 120px;"><span class="uploadify-button-text">上传图片</span></div></div><div id="upload_picture_pic-queue" class="uploadify-queue"></div>
    <input type="hidden" name="pic" value="<?php echo ($data["pic"]); ?>" class="icon pic">
    <div class="upload-img-box">
            <?php if(!empty($data["pic"])): if(is_array($photo)): $i = 0; $__LIST__ = $photo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="upload-pre-item">
<img src="/sjc<?php echo get_cover($vo,$field = path);?>" data-id="<?php echo ($vo); ?>">
<span class="btn-close btn-close-pic" title="删除图片"></span>
</div><?php endforeach; endif; else: echo "" ;endif; endif; ?>
            </div>
                            <script type="text/javascript">
    //上传图片
$(function(){
        /* 初始化上传插件*/
        $("#upload_picture_pic").uploadify({
            "height"          : 30,
            "swf"             : "/sjc/Public/static/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传图片",
            "uploader"        : "/sjc/index.php?s=/Admin/File/uploadPicture/session_id/u21htpemp67tmhf4do23bskak2.html",
            "width"           : 120,
            'removeTimeout'   : 1,
            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
            "onUploadSuccess" : uploadPicturepic,
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        $('.btn-close-pic').click(function(event) {
            
            event.preventDefault();
            $(this).parent().remove();
            picsbox = $("#upload_picture_pic").siblings('.upload-img-box');
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.pic').val(picStr);
        });
})
    function uploadPicturepic(file, data){
        var data = $.parseJSON(data);
        var src = '';
        if(data.status){
            src = data.url || '/sjc' + data.path;
            upload_img = "<div class='upload-pre-item'><img src=" + src +" title='点击显示大图' data-id="+data.id+"> <span class='btn-close btn-close-pic' title='删除图片'></span></div>";
            picsbox = $("#upload_picture_pic").siblings('.upload-img-box');
            picsbox.append(upload_img)
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.pic').val(picStr);
        } else {
            updateAlert(data.info);
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        }
    }
</script>                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">內容<span class="check-tips"></span></label>
                    <div class="controls">
                        <label class="textarea">
<textarea name="content" style="display: none;"><?php echo ($data["content"]); ?></textarea>
                                		<input type="hidden" name="parse" value="0">
		<link rel="stylesheet" href="/sjc/Public/static/kindeditor/default/default.css">
			<script charset="utf-8" src="/sjc/Public/static/kindeditor/kindeditor-min.js"></script>
			<script charset="utf-8" src="/sjc/Public/static/kindeditor/zh_CN.js"></script>
			<script type="text/javascript">
				var editor;
				KindEditor.ready(function(K) {
					editor = K.create('textarea[name="content"]', {
						allowFileManager : false,
						themesPath: K.basePath,
						width: '100%',
						height: '500px',
						resizeType: 1,
						pasteType : 2,
						urlType : 'absolute',
						fileManagerJson : '/sjc/index.php?s=/Admin/Article/fileManagerJson.html',
						//uploadJson : '/sjc/index.php?s=/Admin/Article/uploadJson.html' }
						uploadJson : '/sjc/index.php?s=/Admin/Addons/execute/_addons/EditorForAdmin/_controller/Upload/_action/ke_upimg.html'
					});
				});

				$(function(){
					//传统表单提交同步
					$('textarea[name="content"]').closest('form').submit(function(){
						editor.sync();
					});
					//ajax提交之前同步
					$('button[type="submit"],#submit,.ajax-post').click(function(){
						editor.sync();
					});
				})
			</script>

		                                </label>                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">外景圖<span class="check-tips"></span></label>
                    <div class="controls">
                        <script type="text/javascript" src="/sjc/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/sjc/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="/sjc/Addons/UploadImages/style/UploadImages.css">
    <div id="upload_picture_wpic" class="uploadify" style="height: 30px; width: 120px;"><object id="SWFUpload_2" type="application/x-shockwave-flash" data="/sjc/Public/static/uploadify/uploadify.swf?preventswfcaching=1433321783763" width="120" height="30" class="swfupload" style="position: absolute; z-index: 1;"><param name="wmode" value="transparent"><param name="movie" value="/sjc/Public/static/uploadify/uploadify.swf?preventswfcaching=1433321783763"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_2&amp;uploadURL=%2Fsjc%2Findex.php%3Fs%3D%2FAdmin%2FFile%2FuploadPicture%2Fsession_id%2Fu21htpemp67tmhf4do23bskak2.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=&amp;filePostName=download&amp;fileTypes=*.jpg%3B%20*.png%3B%20*.gif%3B&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=%2Fsjc%2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2"></object><div id="upload_picture_wpic-button" class="uploadify-button " style="height: 30px; line-height: 30px; width: 120px;"><span class="uploadify-button-text">上传图片</span></div></div><div id="upload_picture_wpic-queue" class="uploadify-queue"></div>
    <input type="hidden" name="wpic" value="<?php echo ($data["wpic"]); ?>" class="icon wpic">
    <div class="upload-img-box">
                    <?php if(!empty($data["wpic"])): if(is_array($photo2)): $i = 0; $__LIST__ = $photo2;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="upload-pre-item">
<img src="/sjc<?php echo get_cover($vo,$field = path);?>" data-id="<?php echo ($vo); ?>">
<span class="btn-close btn-close-wpic" title="删除图片"></span>
</div><?php endforeach; endif; else: echo "" ;endif; endif; ?>
            </div>
                            <script type="text/javascript">
    //上传图片
$(function(){
        /* 初始化上传插件*/
        $("#upload_picture_wpic").uploadify({
            "height"          : 30,
            "swf"             : "/sjc/Public/static/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传图片",
            "uploader"        : "/sjc/index.php?s=/Admin/File/uploadPicture/session_id/u21htpemp67tmhf4do23bskak2.html",
            "width"           : 120,
            'removeTimeout'   : 1,
            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
            "onUploadSuccess" : uploadPicturewpic,
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        $('.btn-close-wpic').click(function(event) {
            
            event.preventDefault();
            $(this).parent().remove();
            picsbox = $("#upload_picture_wpic").siblings('.upload-img-box');
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.wpic').val(picStr);
        });
})
    function uploadPicturewpic(file, data){
        var data = $.parseJSON(data);
        var src = '';
        if(data.status){
            src = data.url || '/sjc' + data.path;
            upload_img = "<div class='upload-pre-item'><img src=" + src +" title='点击显示大图' data-id="+data.id+"> <span class='btn-close btn-close-wpic' title='删除图片'></span></div>";
            picsbox = $("#upload_picture_wpic").siblings('.upload-img-box');
            picsbox.append(upload_img)
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.wpic').val(picStr);
        } else {
            updateAlert(data.info);
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        }
    }
</script>                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">內景圖<span class="check-tips"></span></label>
                    <div class="controls">
                        <script type="text/javascript" src="/sjc/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/sjc/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="/sjc/Addons/UploadImages/style/UploadImages.css">
    <div id="upload_picture_npic" class="uploadify" style="height: 30px; width: 120px;"><object id="SWFUpload_3" type="application/x-shockwave-flash" data="/sjc/Public/static/uploadify/uploadify.swf?preventswfcaching=1433321783817" width="120" height="30" class="swfupload" style="position: absolute; z-index: 1;"><param name="wmode" value="transparent"><param name="movie" value="/sjc/Public/static/uploadify/uploadify.swf?preventswfcaching=1433321783817"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_3&amp;uploadURL=%2Fsjc%2Findex.php%3Fs%3D%2FAdmin%2FFile%2FuploadPicture%2Fsession_id%2Fu21htpemp67tmhf4do23bskak2.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=&amp;filePostName=download&amp;fileTypes=*.jpg%3B%20*.png%3B%20*.gif%3B&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=%2Fsjc%2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2"></object><div id="upload_picture_npic-button" class="uploadify-button " style="height: 30px; line-height: 30px; width: 120px;"><span class="uploadify-button-text">上传图片</span></div></div><div id="upload_picture_npic-queue" class="uploadify-queue"></div>
    <input type="hidden" name="npic" value="<?php echo ($data["npic"]); ?>" class="icon npic">
    <div class="upload-img-box">
                            <?php if(!empty($data["npic"])): if(is_array($photo3)): $i = 0; $__LIST__ = $photo3;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="upload-pre-item">
<img src="/sjc<?php echo get_cover($vo,$field = path);?>" data-id="<?php echo ($vo); ?>">
<span class="btn-close btn-close-npic" title="删除图片"></span>
</div><?php endforeach; endif; else: echo "" ;endif; endif; ?>
            </div>
                            <script type="text/javascript">
    //上传图片
$(function(){
        /* 初始化上传插件*/
        $("#upload_picture_npic").uploadify({
            "height"          : 30,
            "swf"             : "/sjc/Public/static/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传图片",
            "uploader"        : "/sjc/index.php?s=/Admin/File/uploadPicture/session_id/u21htpemp67tmhf4do23bskak2.html",
            "width"           : 120,
            'removeTimeout'   : 1,
            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
            "onUploadSuccess" : uploadPicturenpic,
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        $('.btn-close-npic').click(function(event) {
            
            event.preventDefault();
            $(this).parent().remove();
            picsbox = $("#upload_picture_npic").siblings('.upload-img-box');
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.npic').val(picStr);
        });
})
    function uploadPicturenpic(file, data){
        var data = $.parseJSON(data);
        var src = '';
        if(data.status){
            src = data.url || '/sjc' + data.path;
            upload_img = "<div class='upload-pre-item'><img src=" + src +" title='点击显示大图' data-id="+data.id+"> <span class='btn-close btn-close-npic' title='删除图片'></span></div>";
            picsbox = $("#upload_picture_npic").siblings('.upload-img-box');
            picsbox.append(upload_img)
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.npic').val(picStr);
        } else {
            updateAlert(data.info);
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        }
    }
</script>                    </div>
                </div>
<div class="form-item cf">
                    <label class="item-label">地圖坐標<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-4x" name="mapsite" value="<?php echo ($data["mapsite"]); ?>">  <span><a target='_blank' href='http://www.gpsspg.com/maps.htm'>獲取坐標</a></span>                  </div>
                </div>
</div>

	<div class="form-item cf">
			<button class="btn btn-return" id="submit" type="submit" target-form="form-horizontal">確 定</button>
			<a class="btn btn-return" href="<?php echo (cookie('__forward__')); ?>">返 回</a>
			<input type="hidden" name="id" value="<?php echo ((isset($data["id"]) && ($data["id"] !== ""))?($data["id"]):''); ?>"/>
			<input type="hidden" name="pid" value="<?php echo ((isset($data["pid"]) && ($data["pid"] !== ""))?($data["pid"]):''); ?>"/>
			<input type="hidden" name="model_id" value="<?php echo ((isset($data["model_id"]) && ($data["model_id"] !== ""))?($data["model_id"]):''); ?>"/>
			<input type="hidden" name="category_id" value="<?php echo ((isset($data["category_id"]) && ($data["category_id"] !== ""))?($data["category_id"]):''); ?>">
		</div>
</form>
</div>
</div>

        </div>
        <div class="cont-ft">
            <div class="copyright">
                Copyright © <a href="http://iimageonline.com/" target="_blank">I IMAGE STUDIO </a>2015
            </div>
        </div>
    </div>
    <!-- /內容區 -->
    <script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "/sjc", //當前網站地址
            "APP"    : "/sjc/index.php?s=", //當前項目地址
            "PUBLIC" : "/sjc/Public", //項目公共目錄地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    </script>
    <script type="text/javascript" src="/sjc/Public/static/think.js"></script>
    <script type="text/javascript" src="/sjc/Public/Admin/js/common.js"></script>
    <script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();

            /* 左邊菜單高亮 */
            url = window.location.pathname + window.location.search;
            url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
            $subnav.find("a[href='" + url + "']").parent().addClass("current");

            /* 左邊菜單顯示收起 */
            $("#subnav").on("click", "h3", function(){
                var $this = $(this);
                $this.find(".icon").toggleClass("icon-fold");
                $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
                      prev("h3").find("i").addClass("icon-fold").end().end().hide();
            });

            $("#subnav h3 a").click(function(e){e.stopPropagation()});

            /* 頭部管理員菜單 */
            $(".user-bar").mouseenter(function(){
                var userMenu = $(this).children(".user-menu ");
                userMenu.removeClass("hidden");
                clearTimeout(userMenu.data("timeout"));
            }).mouseleave(function(){
                var userMenu = $(this).children(".user-menu");
                userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
                userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
            });

	        /* 表單獲取焦點變色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });

            // 導航欄超出窗口高度後的模擬滾動條
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
    </script>
    
<link href="/sjc/Public/static/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<?php if(C('COLOR_STYLE')=='blue_color') echo '<link href="/sjc/Public/static/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">'; ?>
<link href="/sjc/Public/static/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/sjc/Public/static/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/sjc/Public/static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script>
  
$('.radios').each(function(){

if($(this).val()==$(this).attr('data-check'))
{

$(this).attr('checked','checked');
}

});   
$(function(){
    $('#select1').val($('.add').html()); 
    $('#select2').val($('.house_type').html());    
    $('#select3').val($('.prices').html()); 
})

 
 </script>  
<script type="text/javascript">

Think.setValue("type", <?php echo ((isset($data["type"]) && ($data["type"] !== ""))?($data["type"]):'""'); ?>);
Think.setValue("display", <?php echo ((isset($data["display"]) && ($data["display"] !== ""))?($data["display"]):0); ?>);

$('#submit').click(function(){
$('#form').submit();
});

$(function(){

$('.time').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
language:"zh-CN",
minView:2,
autoclose:true
});
showTab();

<?php if(C('OPEN_DRAFTBOX') and (ACTION_NAME == 'add' or $data['status'] == 3)): ?>//保存草稿
var interval;
$('#autoSave').click(function(){
var target_form = $(this).attr('target-form');
var target = $(this).attr('url')
var form = $('.'+target_form);
var query = form.serialize();
var that = this;

$(that).addClass('disabled').attr('autocomplete','off').prop('disabled',true);
$.post(target,query).success(function(data){
if (data.status==1) {
updateAlert(data.info ,'alert-success');
$('input[name=id]').val(data.data.id);
}else{
updateAlert(data.info);
}
setTimeout(function(){
$('#top-alert').find('button').click();
$(that).removeClass('disabled').prop('disabled',false);
},1500);
})

//重新開始定時器
clearInterval(interval);
autoSaveDraft();
return false;
});

//Ctrl+S保存草稿
$('body').keydown(function(e){
if(e.ctrlKey && e.which == 83){
$('#autoSave').click();
return false;
}
});

//每隔壹段時間保存草稿
function autoSaveDraft(){
interval = setInterval(function(){
//只有基礎信息填寫了，才會觸發
var title = $('input[name=title]').val();
var name = $('input[name=name]').val();
var des = $('textarea[name=description]').val();
if(title != '' || name != '' || des != ''){
$('#autoSave').click();
}
}, 1000*parseInt(<?php echo C('DRAFT_AOTOSAVE_INTERVAL');?>));
}
autoSaveDraft();<?php endif; ?>

});
</script>

</body>
</html>